﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ATEC.GeometryNET;
using ATEC.ATDataCoreNET;
using ATEC.ATCore;
/*using ATEC.ATCCLObject;*/
using ATEC.ATDataCoreNET.ATCCL;
using SSDPNET.DataCore;
using ATEC.ATDataCoreNET.ATObjects;
using ATEC.CCLObj.Entity;


namespace ParameterizedObjectExample
{
  

    public class CircularTable
    {

        public double btmRadius = 0;
        public double topRadius = 0;
        public XPoint3d ptCenter = XPoint3d.FromXYZ(0, 0, 0);
        public double height = 0;


        public SolidCoreEntity GetCircularTable()
        {
            XEllipse3d ellipse_btm = XEllipse3d.FromCenterRadiusXY(ptCenter, btmRadius);
            BasicCurve basicCurve_btm = BasicCurve.CreateArc(ellipse_btm);
            CurveSet curve_btm = CurveSet.Create(CurveSet.BoundaryType.Outer);
            curve_btm.Add(basicCurve_btm);

            XEllipse3d ellipse_top = XEllipse3d.FromCenterRadiusXY(ptCenter + XVector3d.UnitZ * height, topRadius);
            BasicCurve basicCurve_top = BasicCurve.CreateArc(ellipse_top);
            CurveSet curve_top = CurveSet.Create(CurveSet.BoundaryType.Outer);
            curve_top.Add(basicCurve_top);

            List<CurveSet> listProfiles = new List<CurveSet> { curve_btm, curve_top };
            SolidCoreEntity circularBody = null;
            SSDPNET.DataCore.EntityUtl.Create.EntityFromLoft(out circularBody, listProfiles, null, Session.Entity.GetActiveATScenes(), false, false);

            return circularBody;
        }
        /// <summary>
        /// 绘制圆台
        /// </summary>
        public void Draw()
        {
            //获得当前激活的模型空间
            ATSceneRef sceneref = SSDPNET.ScenesFunctions.SceneRefGetActive();
            var custobObject = new ParameterizedObject(sceneref);
            custobObject.btmRadius = 10000;
            custobObject.topRadius = 8000;
            custobObject.ptCenter= XPoint3d.FromXYZ(0, 0, 0);
            custobObject.height = 20000;
            custobObject.AddToScene();
           
        }

    

    }
}
